package ui;

import color.CLRConvert;

public class ColorScaleNegPos extends ColorScale
{
	private boolean bSet;
	public ColorScaleNegPos()
	{
		super();
		bSet = false;
	}
	
	public void setRange(double min, double max)
	{
		if (!bSet)
		{
			double slice = (360.0) / (pxWidth*1.0); // figure out the size of the increment for each pixel slice of the scale
			for (int i = 0; i < pxWidth; i++)
			{
				float[] rgb = CLRConvert.NegativeToPositiveScale(min, max, slice*i);
				colors[i][0] = rgb[0];
				colors[i][1] = rgb[1];
				colors[i][2] = rgb[2];
			}
			bSet = true;
		}
	}
}
